#
# spectrum-lib/src/widgets/CMakeLists.txt
#

# === Decend into plotting directory.
add_subdirectory(plotting)


# === Concatonate 
foreach (file ${widgets_plotting_SRC})
    list(APPEND widgets_SRC plotting/${file})
endforeach ()
foreach (file ${widgets_plotting_MOC})
    list(APPEND widgets_MOC_SRC plotting/${file})
endforeach ()
qt4_wrap_cpp(widgets_SRC ${widgets_MOC_SRC})


# === Build the spectrum_widgets library
add_library(spectrum_widgets SHARED ${widgets_SRC})
target_link_libraries(spectrum_widgets ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
    ${Qwt6_Qt4_LIBRARY})
set_target_properties(spectrum_widgets PROPERTIES
    INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib
    INSTALL_RPATH_USE_LINK_PATH TRUE)
    
    
# === Decend into test directory
add_subdirectory(test)